home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / powervww / pvbutton.h < prev    next >
C/C++ Source or Header  |  1998-01-05  |  2KB  |  79 lines

  1. //  ____________________________________________________
  2. // |                                                    |
  3. // |  Project:     POWER VIEW INTERFACE                 |
  4. // |  File:        PVBUTTON.H                           |
  5. // |  Compiler:    WPP386 (10.6)                        |
  6. // |                                                    |
  7. // |  Subject:     Buttons interface                    |
  8. // |                                                    |
  9. // |  Author:      Emil Dotchevski                      |
  10. // |____________________________________________________|
  11. //
  12. // E-mail: zajo@geocities.com
  13. // URL:    http://www.geocities.com/SiliconValley/Bay/3577
  14.  
  15. #ifndef _PVBUTTON_H
  16. #define _PVBUTTON_H
  17. class Tbutton : public Titem
  18. {
  19. //<R> means read-only
  20. //<R/W> means read/write
  21.   public:
  22.     char *title; //<R> button's title
  23.     uint command; //<R> command to be generated when button pressed
  24.     boolean pressed; //<R> button held down
  25.     uint shortcut; //<R/W> button's keyboard shortcut
  26.     Tbutton( char *t, uint cmd );
  27.     virtual ~Tbutton( void );
  28.     virtual void set_flags( uint _flags_word, boolean enable );
  29.     virtual void set_state( uint _state_word, boolean enable );
  30.     void set_title( char *t );
  31.     void set_cmd( uint cmd );
  32.  
  33.   protected:
  34.     virtual void set_palette( void );
  35.     virtual void draw( void );
  36.     virtual void get_focused( void );
  37.     virtual boolean release_focus( void );
  38.     virtual void event_handler( Tevent &ev );
  39.     virtual void press( void );
  40.     void grab_default( void );
  41.     void release_default( void );
  42. };
  43.  
  44. class Ticon : public Tbutton
  45. {
  46.   public:
  47.     Ticon( char *t, uint cmd, uint _shortcut );
  48.  
  49.   protected:
  50.     virtual void calc_bounds( int delta_xl, int delta_yl );
  51.     virtual void set_palette( void );
  52.     virtual void draw( void );
  53.     virtual void event_handler( Tevent &ev );
  54. };
  55.  
  56. class Tkey : public Titem
  57. {
  58. //<R> means read-only
  59. //<R/W> means read/write
  60.   public:
  61.     uint command; //<R/W>
  62.     uint shortcut; //<R/W>
  63.     Tkey( uint k, uint cmd );
  64.  
  65.   protected:
  66.     virtual void event_handler( Tevent &ev );
  67. };
  68. #endif
  69.  
  70. //CONSTRUCTORS FOR USE WITH DIALOG BOXES
  71.  
  72. Tbutton *button( char *t, uint cmd );
  73. Tbutton *dbutton( char *t, uint cmd );
  74. Tbutton *dcbutton( char *t, uint cmd );
  75. Tbutton *kbutton( char *t );
  76. Tbutton *cbutton( char *t );
  77. Tbutton *hbutton( char *t );
  78. Tkey *key( uint k, uint cmd );
  79.